import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/views/index/IndexView";
import HomeView from "@/views/home/HomeView";
import index from "@/views/goods/IndexView"
import goods from "@/views/goods/goods";
import goods_edit from "@/views/goods/goods_edit";
import LoginView from "@/views/LoginView";
import seller from "@/views/admin/seller";
import password from "@/views/admin/password";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: IndexView,
    children:[
      {
        path: '/',
        name: 'home',
        component: HomeView
      },
      {
        path: '/index',
        name: 'index',
        component: index,
        children: [
          {
            path: "goods",
            name: "goods",
            component: goods
          },
          {
            path: "password",
            name: "password",
            component: password
          },
          {
            path: "seller",
            name: "seller",
            component: seller
          },
          {
            path: "goods_edit",
            name: "goods_edit",
            component: goods_edit
          }
        ]
      }
    ]
  },
  {
    path: "/login",
    component: LoginView
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
